import 'package:flutter/material.dart';

class BudgetAvatar extends StatelessWidget {
  final List<String> arguments;
  const BudgetAvatar({
    Key key,
    @required this.arguments,
  }) : super(key: key);

  String combineLetter(String a, String b) {
    var fullLetter = a;
    if (b.isNotEmpty) {
      fullLetter += b.substring(0, 1).toUpperCase();
    }
    return fullLetter;
  }

  String _capitalLetter() {
    return arguments.fold('', combineLetter);
  }

  @override
  Widget build(BuildContext context) {
    return new Container(
      width: 32.0,
      height: 32.0,
      decoration: BoxDecoration(
        shape: BoxShape.circle,
        color: Colors.black,
      ),
      child: Center(
        child: Text(
          _capitalLetter(),
          style: TextStyle(color: Colors.white),
        ),
      ),
    );
  }
}
